<?php
/**
 * Created By PhpStorm
 * Author: patrick wu
 * Date: 2020/11/25
 * Time: 10:47
 */
namespace App\Http\Model\Mysql;

use Illuminate\Database\Eloquent\Model;

class ShortVideoModel extends Model
{
    const IS_DELETE     =   1,
        NOT_DELETE      =   0;

    protected $table    =   'mini_short_video';

    protected $guarded  =   [];

    protected $dateFormat   =   'U';

    /**
     * 定义连接商品表
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function good()
    {
        return $this->hasMany(ShortGoodModel::class, 'video_id', 'id');
    }

    /**
     * 定义连接用户收藏表
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function collect()
    {
        return $this->hasMany(ShortCollectModel::class, 'video_id', 'id');
    }
}
